draw a rectangle in keras draw_box

38

model = load_model("modelname.h5")
(_, Contours ,_) = cv2.findContours(Image,cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)
for area in Contours:
    (x, y, w, h) = cv2.boundingRect(area)
    ObjROI = Image[y : y+h, x : x+w]
    p = model.predict(cv2.resize(ObjROI, (<size of CNN input>)))

Comments

Submit
0 Comments